/*
 * Copyright (C) 2006-2015
 * 版权所有者为北京捷越联合信息咨询有限公司。本系统是商用软件,未经授权擅自复制或传播本程序的部分或全部将是非法的。
 * @title: RepaymentPlanDao.java
 * @package com.jy.modules.cims.data.dao
 * @author zhaox
 * @date 2015-3-5 下午4:53:03
 * @version v1.00
 * @description: TODO(用一句话描述该文件做什么)
 */

package com.jy.modules.cims.data.dao;

import java.util.List;
import java.util.Map;

import com.jy.modules.cims.data.dto.CreditDetailDto;
import com.jy.modules.cims.data.dto.credit.CreditRepayPlanDealDto;
import com.jy.modules.cims.data.dto.credit.CreditSettleParam;
import com.jy.modules.cims.data.interact.core.credit.response.ResponseRepayPlanDTO;
import com.jy.modules.cims.data.interact.core.loan.response.LoanSchedule;
import com.jy.platform.core.mybatis.MyBatisRepository;

/**
 * @classname: RepaymentPlanDao
 * @description: TODO(这里用一句话描述这个类的作用)
 */
@MyBatisRepository
public interface RepaymentPlanDao {

    public List<CreditDetailDto> queryCreditDetail(Map map);

    public List<CreditDetailDto> queryCreditDetailsByPaging(Map map);

    /************* 提前结清处理逻辑 *******************/
    /**
     * 查询需要更新还款计划的债权
     * 
     * @title: queryCreditDetails
     * @author
     * @description:
     * @date 2015-3-5 下午4:55:25
     * @return
     * @throws
     */
    public List<CreditDetailDto> queryCreditDetails(String creditStatus);

    /**
     * 查询需要更新还款计划的债权
     * 
     * @title: queryCreditDetails
     * @author
     * @description:
     * @date 2015-3-5 下午4:55:25
     * @return
     * @throws
     */
    public List<CreditSettleParam> queryCreditDetailsToday(String creditStatus);
    
    /**
     * 查询受让需要结算还款计划的债权
     * 
     * @title: queryCreditDetails
     * @author
     * @description:
     * @date 2015-3-5 下午4:55:25
     * @return
     * @throws
     */
    public List<CreditSettleParam> queryCreditDetailsRec(String dealCode);
    
    /**
     * 查询受让需要结算还款计划的债权维护功能
     * 
     * @title: queryCreditDetails
     * @author
     * @description:
     * @date 2015-3-5 下午4:55:25
     * @return
     * @throws
     */
    public List<CreditSettleParam> RecTransferIdPlans(String transferId);

    /**
     * 初始化还款计划
     * 
     * @title: insertPlanList
     * @author
     * @description:
     * @date 2015-3-9 下午3:58:51
     * @param list
     * @throws
     */
    public void insertPlanList(List<ResponseRepayPlanDTO> list);
    
    /**
     * 抵押贷初始化还款计划
     * 
     * @title: insertPlanList
     * @author
     * @description:
     * @date 2015-3-9 下午3:58:51
     * @param list
     * @throws
     */
    public void insertPlanListDYD(List<ResponseRepayPlanDTO> list);

    /**
     * 初始化结算计划
     * 
     * @title: insertCostList
     * @author
     * @description:
     * @date 2015-3-9 下午3:58:59
     * @param list
     * @throws
     */
    public void insertCostList(List<ResponseRepayPlanDTO> list);

    /**
     * 根据债权编号查询当前处理到第几批次第几期
     * 
     * @title: queryPlanDeal
     * @author
     * @description:
     * @date 2015-3-6 上午10:37:33
     * @param paramMap
     * @return
     * @throws
     */
    public List<CreditRepayPlanDealDto> queryPlanDeal(Map paramMap);

    /**
     * 根据债权编号查询合约中对于提前结清，逾期的处理类型
     * 
     * @title: queryPlanContractDealMode
     * @author
     * @description:
     * @date 2015-3-6 下午2:51:04
     * @param paramMap
     * @return
     * @throws
     */
    public List<Map> queryPlanContractDealMode(Map paramMap);

    /**
     * 更新还款计划
     * 
     * @title: updateAdvanceRepaymentPlans
     * @author
     * @description:
     * @date 2015-3-6 下午1:44:57
     * @param paramMap（creditCode，currentTime）
     * @throws
     */
    public void updateAdvanceRepaymentPlans(Map paramMap);

    /**
     * 更新结算计划
     * 
     * @title: updateAdvanceRepaymentPlans
     * @author
     * @description:
     * @date 2015-3-6 下午1:44:57
     * @param paramMap（creditCode，currentTime）
     * @throws
     */
    public void updateVirtualRepaymentCosts(Map paramMap);

    /**
     * 更新结算计划
     * 
     * @title: updateCostPlan
     * @author
     * @description:
     * @date 2015-3-6 下午1:52:42
     * @param paramMap
     * @throws
     */
    public void updateCostPlans(Map paramMap);

    /**
     * 更新债权标识
     * 
     * @title: updateCreditFlag
     * @author
     * @description:
     * @date 2015-3-5 下午5:54:12
     * @param paramMap
     * @throws
     */
    public void updateCreditFlag(Map paramMap);

    /**
     * 更新该期还款计划变更标志
     * 
     * @title: updatePlanChanged
     * @author
     * @description:
     * @date 2015-3-6 下午2:01:08
     * @param paramMap
     * @throws
     */
    public void updatePlanChanged(Map paramMap);

    /**
     * 更新该期结算计划变更标志
     * 
     * @title: updatePlanChanged
     * @author
     * @description:
     * @date 2015-3-6 下午2:01:08
     * @param paramMap
     * @throws
     */
    public void updateCostChanged(Map paramMap);
    
    /**
     * 更新该期结算计划变更标志
     * 
     * @title: updateCostPlanChanged
     * @author
     * @description:
     * @date 2015-3-6 下午2:01:08
     * @param paramMap
     * @throws
     */
    public void updateCostPlanChanged(Map paramMap);

    /************* 虚拟现金流处理逻辑 *******************/
    /**
     * 更新还款计划的本金和本息
     * 
     * @title: updateVirtualRepaymentPlans
     * @author
     * @description:
     * @date 2015-3-5 下午5:54:45
     * @throws
     */
    public void updateVirtualRepaymentPlans(Map paramMap);

    /**
     * 记录更新的还款计划批次
     * 
     * @title: insertPlanBatch
     * @author
     * @description:
     * @date 2015-3-11 上午11:23:09
     * @param paramMap
     * @throws
     */
    public void insertPlanBatch(Map paramMap);

    /**
     * 初始化贷款还款计划
     * 
     * @title: insertPlanList
     * @author
     * @description:
     * @date 2015-3-9 下午3:58:51
     * @param list
     * @throws
     */
    public void insertLoanPlanList(List<LoanSchedule> list);

    public void deletePlanList(Map paramMap);

    public int selectCountLoanPlans(Map paramMap);
    
    public int selectCountSettlePlans(Map paramMap);

    /**
     * 根据当前时间查询第几期变更
     * 
     * @title: selectCurrentTime
     * @author
     * @description:
     * @date 2015-5-21 上午10:46:55
     * @param date
     * @return
     * @throws
     */
    public int selectCurrentTime(Map paramMap);

    /**
     * 查询账单日
     * 
     * @title: selectCurrentTime
     * @author
     * @description:
     * @date 2015-5-21 上午10:46:55
     * @param date
     * @return
     * @throws
     */
    public int selectBillDate(Map paramMap);

    public void insertLoanBatch(Map paramMap);

    public int queryLoanDeal(Map paramMap);

    public Map selectCurrentTimeAndStatus(Map paramMap);

    /**
     * 初始化结算计划
     * 
     * @title: initSettlePlan
     * @author
     * @description:
     * @date 2015-7-21 下午2:29:11
     * @param paramMap
     * @throws
     */
    public void initSettlePlan(List list);

    /**
     * 更新历史结算计划
     * 
     * @title: updateSettlePlan
     * @author
     * @description:
     * @date 2015-7-29 上午10:17:00
     * @param list
     * @throws
     */
    public void updateSettlePlan(Map paramMap);
    
    /**
     * 更新历史结算计划
     * 
     * @title: updateSettlePlan
     * @author
     * @description:
     * @date 2015-7-29 上午10:17:00
     * @param list
     * @throws
     */
    public void updateSettlePlan1(Map paramMap);

    /**
     * 初始化结算计划后更新债权明细状态为已生成
     * 
     * @title: updateCreditDetialStatus
     * @author
     * @description:
     * @date 2015-7-21 下午4:14:04
     * @param paramMap
     * @throws
     */
    public void updateCreditDetialStatus(Map paramMap);

    /**
     * 查询借款人还款计划
     * 
     * @title: selectMatchAmt
     * @author
     * @description:
     * @date 2015-7-23 上午10:28:51
     * @param paramMap
     * @return
     * @throws
     */
    public List selectMatchAmt(Map paramMap);

    public Map selectPrincipal(Map paramMap);

    /**
     * 查询需要生成结算计划
     * 
     * @title: queryCreditSettleParamByPaging
     * @author
     * @description:
     * @date 2015-7-30 上午11:09:58
     * @param paramMap
     * @return
     * @throws
     */
    public List queryCreditSettleParamByPaging(Map paramMap);

    public List queryCreditSettleParam(Map paramMap);
    
    public void updateCreditValueChanged(Map paramMap);
    
    
    public void updateReplaceType01(Map paramMap);
    public void updateReplaceType02(Map paramMap);
    public void updateReplaceType03(Map paramMap);
}
